package com.zzy.springboot_security.controll;

import com.zzy.springboot_security.entity.User;
import com.zzy.springboot_security.service.UserService;
import com.zzy.springboot_security.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author ZhuZhengYang
 * @description TODO
 * @since 2022/1/19
 */
@Controller
public class RouterControll {

/*    @Autowired
    UserServiceImpl userService;*/

    @RequestMapping({"/","/index"})
    public String index(){

        return "index";
    }

    @RequestMapping("/toLogin")
    public String toLogin(){
        return "views/login";
    }

    @RequestMapping("/level1/{id}")
    public String level1(@PathVariable("id") int id){
        return "views/level1/"+id;
    }
    @RequestMapping("/level2/{id}")
    public String level2(@PathVariable("id") int id){
        return "views/level2/"+id;
    }
    @RequestMapping("/level3/{id}")
    public String level3(@PathVariable("id") int id){
        return "views/level3/"+id;
    }

   /* @RequestMapping("/getUser/{name}")
    @ResponseBody
    public String findUser(@PathVariable("name") String name){
        User user = userService.findUser(name);
        String userName = user.getName();


        return userName;}*/



}
